﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="ResetName.aspx.cs" Inherits="Whir_System_Module_Template_ResetName" %>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <link href="../../Skin/Default/Css/main.css" rel="stylesheet" type="text/css" />
    <base target="_self" />
</head>
<body onload="setEdit();" scroll="no">
    <form id="form1" runat="server">
        <table width="100%" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#DADADA">
            <tr>
                <td height="26" colspan="2" align="left" class="form_title"><strong>重命名</strong></td>
            </tr>
            <tr>
                <td width="80px" height="30" align="center" class="form_tdText">名称</td>
                <td align="left" class="form_td">
                    <asp:TextBox ID="txt1" runat="server"></asp:TextBox></td>
            </tr>
            <tr>
                <td height="30" align="center" class="form_tdText"></td>
                <td align="left" class="form_td">
                    <asp:Button ID="btnSubmit" runat="server" Text="修改" CssClass="btn_default" OnClick="btnSubmit_Click"
                        OnClientClick="return checkForm();" />
                </td>
            </tr>
        </table>
        <asp:HiddenField ID="hfDir" runat="server" />
    </form>
</body>
</html>

<script language="vbscript">      
Function asc2str(ascasc)    
 asc2str = chr(ascasc)    
End Function   
</script>

<script language="javascript">   
function UrlDecode(str)
{    
  var ret="";    
  for(var i=0;i<str.length;i++)
  {    
   var chr = str.charAt(i);    
    if(chr == "+")
    {    
      ret+=" ";    
    }
    else if(chr=="%")
    {    
     var asc = str.substring(i+1,i+3);    
     if(parseInt("0x"+asc)>0x7f)
     {    
      ret+=asc2str(parseInt("0x"+asc+str.substring(i+4,i+6)));    
      i+=5;    
     }
     else
     {    
      ret+=asc2str(parseInt("0x"+asc));    
      i+=2;    
     }    
    }
    else
    {    
      ret+= chr;    
    }    
  }    
  return ret;    
}    
</script>

<script language="javascript">
function setEdit()
{ 
    //判断是否第一次加载
    var ispostback = '<%= isPostBack %>';
    if(ispostback == '1')
        return;
    //end

    var hf = document.getElementById("hfDir");
    hf.value = decodeURI(window.dialogArguments);
    var vs = hf.value.split('\\');
    document.getElementById("txt1").value = vs[vs.length-1].split('.')[0];
}

function checkForm()
{
    var txt = document.getElementById("txt1");
    if(txt.value.search(/^[^:\\\?\|]+$/) == -1)
    {
        alert("请输入正确的文件夹名!")
        txt.select();
        return false;
    }
    return true;
}
</script>

<script language="javascript" src="../../Js/common.js"></script>

<script type="text/javascript">initAutoFormStyle();</script>

